import { fetch } from './api'
// 获取城市
let _cities = () => {
  return fetch(
    '/user.ashx',
    {
      work: 'getcity'
    }
  )
}
// 获取部门
let _departments = () => {
  return fetch(
    '/user.ashx',
    {
      work: 'getdepartment'
    }
  )
}
// 考试列表
let _list = (MemberID, City, Department, Name, ExType, PageIndex, PageSize) => {
  return fetch(
    '/user.ashx',
    {
      MemberID,
      City,
      Department,
      Name,
      ExType,
      PageIndex,
      PageSize,
      work: 'getexlist'
    }
  )
}
// 考试说明
let _intro = id => {
  return fetch(
    '/user.ashx',
    {
      ExamID: id,
      work: 'getexinfo'
    }
  )
}
// 判断是否参加过考试
let _check = (MemberID, ExamID) => {
  return fetch(
    '/user.ashx',
    {
      MemberID,
      ExamID,
      work: 'checkexam'
    }
  )
}
// 查询单次考试成绩
let _result = (MemberID, ExamID) => {
  return fetch(
    '/user.ashx',
    {
      MemberID,
      ExamID,
      work: 'getexresult'
    }
  )
}
// 单题解析
let _analyse = (ExRepID, ExamID, MemberID) => {
  return fetch(
    '/user.ashx',
    {
      ExRepID,
      ExamID,
      MemberID,
      work: 'getansinfo'
    }
  )
}
// 获取题目
let _question = (ExamID, MemberID) => {
  return fetch(
    '/user.ashx',
    {
      ExamID,
      MemberID,
      work:'getexreport'
    }
  )
}
// 考试提交
let _submit = (MemberID, ExamID, ExRepID, Ans,IsOver) => {
  return fetch(
    '/user.ashx',
    {
      MemberID,
      ExamID,
      ExRepID,
      Ans,
      IsOver,
      work: 'postans'
    }
  )
}
export {
  _cities,
  _departments,
  _list,
  _intro,
  _check,
  _result,
  _analyse,
  _question,
  _submit
}